package cz.muni.fi.pa165.languageschool.service;

import cz.muni.fi.pa165.languageschool.dto.StudentTO;
import java.util.Collection;

/**
 * Interface for service dealing with Student entities
 *
 * @author Michal Fučík (395624) michal.fuca.fucik(at)gmail.com, Marketa
 * Trachtova (255498) marketa.tr(at)gmail.com
 */
public interface StudentService {

    /**
     * Creates new student.
     *
     * @param student The student entity. Student cannot be null.
     */
    void createStudent(StudentTO student);

    /**
     * Fetches all students within the database
     *
     * @return collection
     */
    Collection<StudentTO> getAllStudents();

    /**
     * Fetch student by given id.
     *
     * @param id Id of searched student.
     * @return The found student or null if there is not anyone with given id.
     */
    StudentTO getStudent(Long id);

    /**
     * Update student.
     *
     * @param student Student to be updated.
     */
    void updateStudent(StudentTO student);

    /**
     * Delete student
     *
     * @param student Student to be deleted.
     */
    void deleteStudent(StudentTO student);

    /**
     * Find student by username.
     *
     * @param username Student's username to be found.
     * @return studentTO
     */
    StudentTO findByUsername(String username);
}
